package com.fenghongzhang.test.design;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.fenghongzhang.test.R;
import com.google.android.material.tabs.TabLayout;

public class Main6Activity extends AppCompatActivity {
    private TabLayout mytab;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main6);

        mytab = (TabLayout) findViewById(R.id.mytab);
        TabLayout tabLayout = (TabLayout) findViewById(R.id.mytab);
//        tabLayout.addTab(tabLayout.newT/**/ab().setText("选项卡一").setIcon(R.mipmap.ic_launcher));
        tabLayout.addTab(tabLayout.newTab().setText("选项卡二").setIcon(R.mipmap.ic_launcher));
        tabLayout.addTab(tabLayout.newTab().setText("选项卡三").setIcon(R.mipmap.ic_launcher));
        tabLayout.addTab(tabLayout.newTab().setText("选项卡四").setIcon(R.mipmap.ic_launcher));
        tabLayout.addTab(tabLayout.newTab().setText("选项卡五").setIcon(R.mipmap.ic_launcher));
        tabLayout.addTab(tabLayout.newTab().setText("选项卡六").setIcon(R.mipmap.ic_launcher));

    }
}
